<template>
  <span class="login" @click="login">{{ loggedIn ? '登陆' : '未登陆' }}</span>
</template>

<script setup lang="ts">
import useUserStore from '@/store/user'
import { useRouter } from 'vue-router'

const store = useUserStore()
const { loggedIn } = store

const router = useRouter()
const login = () => {
  router.push('/login')
}
</script>

<style scoped lang="less">
.login {
  cursor: pointer;
}
</style>
